package br.com.cnpv.modelo.entity;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="tipo_veiculo")
@NamedQueries(
		{ 
			@NamedQuery(name="TipoVeiculo.listar", query="select t from TipoVeiculo t ")
		}
	)
public class TipoVeiculo {

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="id")
	private Integer id;
	
	@Column(name="ds_tipo_veiculo")
	private String dsTipoVeiculo;
	
	@Column(name="dt_incl")
	private Date dtIncl;
	
	@Column(name="dt_alter")
	private Date dtAlter;
	
	@Column(name="dt_inat")
	private Date dtInat;
	
	@Column(name="id_usuario")
	private String idUsuario;
	
	@OneToMany(fetch=FetchType.LAZY)
	@JoinColumn(name="id_veiculo", insertable=false, updatable=false, referencedColumnName="id")
	private List<Veiculo> veiculoList;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getDsTipoVeiculo() {
		return dsTipoVeiculo;
	}

	public void setDsTipoVeiculo(String dsTipoVeiculo) {
		this.dsTipoVeiculo = dsTipoVeiculo;
	}

	public Date getDtIncl() {
		return dtIncl;
	}

	public void setDtIncl(Date dtIncl) {
		this.dtIncl = dtIncl;
	}

	public Date getDtAlter() {
		return dtAlter;
	}

	public void setDtAlter(Date dtAlter) {
		this.dtAlter = dtAlter;
	}

	public Date getDtInat() {
		return dtInat;
	}

	public void setDtInat(Date dtInat) {
		this.dtInat = dtInat;
	}

	public String getIdUsuario() {
		return idUsuario;
	}

	public void setIdUsuario(String idUsuario) {
		this.idUsuario = idUsuario;
	}

	public List<Veiculo> getVeiculoList() {
		return veiculoList;
	}

	public void setVeiculoList(List<Veiculo> veiculoList) {
		this.veiculoList = veiculoList;
	}


}